In recent years, a method of encoding an image with markedly improved coding efficiency is recommended as ITU-T REC. H.264 and ISO/IEC 14496-10 (hereinafter, referred to as “H.264”) in cooperation of ITU-T (International Telecommunication Union Telecommunication Standardization Sector) and ISO (International Organization for Standardization)/IEC (International Electrotechnical Commission).
In H.264, an inter-prediction coding system is disclosed in which redundancy in the time direction is eliminated to achieve high coding efficiency by making a motion compensation prediction of fractional precision using a coded image as a reference image.
In addition, a system is proposed in which a moving image including a fading or dissolving effect is encoded with efficiency higher than that of an inter-prediction coding system according to ISO/IEC MPEG (Moving Picture Experts Group)−1, 2, 4. In this system, a motion compensation prediction of fractional precision is made for an input moving image having luminance and two color differences as frames for predicting a change in the brightness in the time direction. Then, by using a reference image, luminance, and a weighting factor for each luminance and two color differences, an offset and for each luminance and two color differences, and the like, a predicted image is multiplied by a weighting factor, and an offset is added thereto. The weighting factor can represent a fraction with predetermined precision using a parameter representing fixed point precision, and a weighted motion-compensated prediction can be made for a pixel value change between images with more delicate precision.
In a conventional technology as described above, while a reference image, a weighting factor, an offset, and the like are encoded as an index, the index is defined to be represented with predetermined bit precision, and accordingly, there are cases where a weighting factor cannot be represented. An object of the present invention is to provide an encoding method, a decoding method, an encoding device, and a decoding device capable of improving the coding efficiency while representing a weighting factor with predetermined bit precision.